<?php

/**
 * DecHabitacion form base class.
 *
 * @method DecHabitacion getObject() Returns the current form's model object
 *
 * @package    PhpProject1
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseDecHabitacionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'hab_id'                 => new sfWidgetFormInputHidden(),
      'hab_edificio_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('DecEdificio'), 'add_empty' => true)),
      'hab_habitacion_tipo_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('DecHabitacionTipo'), 'add_empty' => true)),
      'hab_numero'             => new sfWidgetFormInputText(),
      'hab_precio'             => new sfWidgetFormInputText(),
      'hab_activo'             => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'hab_id'                 => new sfValidatorChoice(array('choices' => array($this->getObject()->get('hab_id')), 'empty_value' => $this->getObject()->get('hab_id'), 'required' => false)),
      'hab_edificio_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('DecEdificio'), 'required' => false)),
      'hab_habitacion_tipo_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('DecHabitacionTipo'), 'required' => false)),
      'hab_numero'             => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'hab_precio'             => new sfValidatorNumber(array('required' => false)),
      'hab_activo'             => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('dec_habitacion[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'DecHabitacion';
  }

}
